<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QKeySequence Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">&#160;&#160;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QKeySequence Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1><p>The QKeySequence class encapsulates a key sequence as used by
shortcuts. <a href="#details">More...</a></p>

<h3>Types</h3><ul><li><div class="fn" />enum <b><a href="qkeysequence.html#SequenceFormat-enum">SequenceFormat</a></b> { NativeText, PortableText }</li><li><div class="fn" />enum <b><a href="qkeysequence.html#SequenceMatch-enum">SequenceMatch</a></b> { NoMatch, PartialMatch, ExactMatch }</li><li><div class="fn" />enum <b><a href="qkeysequence.html#StandardKey-enum">StandardKey</a></b> { UnknownKey, HelpContents, WhatsThis, Open, ..., Quit }</li></ul><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qkeysequence.html#QKeySequence">__init__</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qkeysequence.html#QKeySequence-2">__init__</a></b> (<i>self</i>, QKeySequence&#160;<i>ks</i>)</li><li><div class="fn" /><b><a href="qkeysequence.html#QKeySequence-3">__init__</a></b> (<i>self</i>, QString&#160;<i>key</i>, SequenceFormat&#160;<i>format</i>)</li><li><div class="fn" /><b><a href="qkeysequence.html#QKeySequence-4">__init__</a></b> (<i>self</i>, int&#160;<i>k1</i>, int&#160;<i>key2</i>&#160;=&#160;0, int&#160;<i>key3</i>&#160;=&#160;0, int&#160;<i>key4</i>&#160;=&#160;0)</li><li><div class="fn" /><b><a href="qkeysequence.html#QKeySequence-5">__init__</a></b> (<i>self</i>, QVariant&#160;<i>variant</i>)</li><li><div class="fn" />int <b><a href="qkeysequence.html#count">count</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qkeysequence.html#isDetached">isDetached</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qkeysequence.html#isEmpty">isEmpty</a></b> (<i>self</i>)</li><li><div class="fn" />SequenceMatch <b><a href="qkeysequence.html#matches">matches</a></b> (<i>self</i>, QKeySequence&#160;<i>seq</i>)</li><li><div class="fn" />QString <b><a href="qkeysequence.html#toString">toString</a></b> (<i>self</i>, SequenceFormat&#160;<i>format</i>&#160;=&#160;QKeySequence.PortableText)</li></ul><h3>Static Methods</h3><ul><li><div class="fn" />QKeySequence <b><a href="qkeysequence.html#fromString">fromString</a></b> (QString&#160;<i>str</i>, SequenceFormat&#160;<i>format</i>&#160;=&#160;QKeySequence.PortableText)</li><li><div class="fn" />list-of-QKeySequence <b><a href="qkeysequence.html#keyBindings">keyBindings</a></b> (StandardKey&#160;<i>key</i>)</li><li><div class="fn" />QKeySequence <b><a href="qkeysequence.html#mnemonic">mnemonic</a></b> (QString&#160;<i>text</i>)</li></ul><h3>Special Methods</h3><ul><li><div class="fn" />bool <b><a href="qkeysequence.html#__eq__">__eq__</a></b> (<i>self</i>, QKeySequence&#160;<i>other</i>)</li><li><div class="fn" />bool <b><a href="qkeysequence.html#__ge__">__ge__</a></b> (<i>self</i>, QKeySequence&#160;<i>other</i>)</li><li><div class="fn" />int <b><a href="qkeysequence.html#__getitem__">__getitem__</a></b> (<i>self</i>, int&#160;<i>i</i>)</li><li><div class="fn" />bool <b><a href="qkeysequence.html#__gt__">__gt__</a></b> (<i>self</i>, QKeySequence&#160;<i>other</i>)</li><li><div class="fn" />int <b><a href="qkeysequence.html#__int__">__int__</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qkeysequence.html#__le__">__le__</a></b> (<i>self</i>, QKeySequence&#160;<i>other</i>)</li><li><div class="fn" /> <b><a href="qkeysequence.html#__len__">__len__</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qkeysequence.html#__lt__">__lt__</a></b> (<i>self</i>, QKeySequence&#160;<i>ks</i>)</li><li><div class="fn" />bool <b><a href="qkeysequence.html#__ne__">__ne__</a></b> (<i>self</i>, QKeySequence&#160;<i>other</i>)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>This class can be pickled.</p><p>
    <a href="qkeysequence.html#StandardKey-enum">StandardKey</a>,
    <a href="qstring.html">QString</a>
    or a Python int object
    may be used whenever
    <a href="qkeysequence.html">QKeySequence</a>
    is expected.</p>
  <p>The QKeySequence class encapsulates a key sequence as used by
shortcuts.</p>
<p>In its most common form, a key sequence describes a combination
of keys that must be used together to perform some action. Key
sequences are used with <a href="qaction.html">QAction</a> objects
to specify which keyboard shortcuts can be used to trigger
actions.</p>
<p>Key sequences can be constructed for use as keyboard shortcuts
in three different ways:</p>
<ul>
<li>For standard shortcuts, a <a href="qkeysequence.html#StandardKey-enum">standard key</a> can be used
to request the platform-specific key sequence associated with each
shortcut.</li>
<li>For custom shortcuts, human-readable strings such as "Ctrl+X"
can be used, and these can be translated into the appropriate
shortcuts for users of different languages. Translations are made
in the "<a href="qshortcut.html">QShortcut</a>" context.</li>
<li>For hard-coded shortcuts, integer key codes can be specified
with a combination of values defined by the <a href="qt.html#Key-enum">Qt.Key</a> and <a href="qt.html#Modifier-enum">Qt.Modifier</a> enum values. Each key code
consists of a single <a href="qt.html#Key-enum">Qt.Key</a> value
and zero or more modifiers, such as <a href="qt.html#Modifier-enum">Qt.SHIFT</a>, <a href="qt.html#Modifier-enum">Qt.CTRL</a>, <a href="qt.html#Modifier-enum">Qt.ALT</a> and <a href="qt.html#Modifier-enum">Qt.META</a>.</li>
</ul>
<p>For example, <b>Ctrl P</b> might be a sequence used as a
shortcut for printing a document, and can be specified in any of
the following ways:</p>
<pre class="cpp">
 <span class="type">QKeySequence</span>(<span class="type">QKeySequence</span><span class="operator">.</span>Print);
 <span class="type">QKeySequence</span>(tr(<span class="string">"Ctrl+P"</span>));
 <span class="type">QKeySequence</span>(tr(<span class="string">"Ctrl+p"</span>));
 <span class="type">QKeySequence</span>(<span class="type"><a href="qt.html">Qt</a></span><span class="operator">.</span>CTRL <span class="operator">+</span> <span class="type"><a href="qt.html">Qt</a></span><span class="operator">.</span>Key_P);
</pre>
<p>Note that, for letters, the case used in the specification
string does not matter. In the above examples, the user does not
need to hold down the <b>Shift</b> key to activate a shortcut
specified with "Ctrl+P". However, for other keys, the use of
<b>Shift</b> as an unspecified extra modifier key can lead to
confusion for users of an application whose keyboards have
different layouts to those used by the developers. See the <a href="#keyboard-layout-issues">Keyboard Layout Issues</a> section below
for more details.</p>
<p>It is preferable to use standard shortcuts where possible. When
creating key sequences for non-standard shortcuts, you should use
human-readable strings in preference to hard-coded integer
values.</p>
<p>QKeySequence objects can be cast to a <a href="qstring.html">QString</a> to obtain a human-readable translated
version of the sequence. Similarly, the <a href="qkeysequence.html#toString">toString</a>() function produces
human-readable strings for use in menus. On Mac OS X, the
appropriate symbols are used to describe keyboard shortcuts using
special keys on the Macintosh keyboard.</p>
<p>An alternative way to specify hard-coded key codes is to use the
Unicode code point of the character; for example, 'A' gives the
same key sequence as <a href="qt.html#Key-enum">Qt.Key_A</a>.</p>
<p><b>Note:</b> On Mac OS X, references to "Ctrl", <a href="qt.html#Modifier-enum">Qt.CTRL</a>, Qt.Control and <a href="qt.html#KeyboardModifier-enum">Qt.ControlModifier</a> correspond
to the <b>Command</b> keys on the Macintosh keyboard, and
references to "Meta", <a href="qt.html#Modifier-enum">Qt.META</a>,
Qt.Meta and <a href="qt.html#KeyboardModifier-enum">Qt.MetaModifier</a> correspond to
the <b>Control</b> keys. Developers on Mac OS X can use the same
shortcut descriptions across all platforms, and their applications
will automatically work as expected on Mac OS X.</p>
<a id="standard-shortcuts" name="standard-shortcuts" />
<h3>Standard Shortcuts</h3>
<p>QKeySequence defines many <a href="qkeysequence.html#StandardKey-enum">standard keyboard
shortcuts</a> to reduce the amount of effort required when setting
up actions in a typical application. The table below shows some
common key sequences that are often used for these standard
shortcuts by applications on four widely-used platforms. Note that
on Mac OS X, the <b>Ctrl</b> value corresponds to the
<b>Command</b> keys on the Macintosh keyboard, and the <b>Meta</b>
value corresponds to the <b>Control</b> keys.</p>
<table class="generic">
<thead>
<tr class="qt-style">
<th><a href="qkeysequence.html#StandardKey-enum">StandardKey</a></th>
<th>Windows</th>
<th>Mac OS X</th>
<th>KDE</th>
<th>GNOME</th>
<th>S60</th>
</tr>
</thead>
<tr class="odd" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">HelpContents</a></td>
<td>F1</td>
<td>Ctrl+?</td>
<td>F1</td>
<td>F1</td>
<td>F2</td>
</tr>
<tr class="even" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">WhatsThis</a></td>
<td>Shift+F1</td>
<td>Shift+F1</td>
<td>Shift+F1</td>
<td>Shift+F1</td>
<td>Shift+F1</td>
</tr>
<tr class="odd" valign="top">
<td>Open</td>
<td>Ctrl+O</td>
<td>Ctrl+O</td>
<td>Ctrl+O</td>
<td>Ctrl+O</td>
<td>(none)</td>
</tr>
<tr class="even" valign="top">
<td>Close</td>
<td>Ctrl+F4, Ctrl+W</td>
<td>Ctrl+W, Ctrl+F4</td>
<td>Ctrl+W</td>
<td>Ctrl+W</td>
<td>(none)</td>
</tr>
<tr class="odd" valign="top">
<td>Save</td>
<td>Ctrl+S</td>
<td>Ctrl+S</td>
<td>Ctrl+S</td>
<td>Ctrl+S</td>
<td>(none)</td>
</tr>
<tr class="even" valign="top">
<td>Quit</td>
<td />
<td>Ctrl+Q</td>
<td>Qtrl+Q</td>
<td>Qtrl+Q</td>
<td>(none)</td>
</tr>
<tr class="odd" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">SaveAs</a></td>
<td />
<td>Ctrl+Shift+S</td>
<td />
<td>Ctrl+Shift+S</td>
<td>(none)</td>
</tr>
<tr class="even" valign="top">
<td>New</td>
<td>Ctrl+N</td>
<td>Ctrl+N</td>
<td>Ctrl+N</td>
<td>Ctrl+N</td>
<td>(none)</td>
</tr>
<tr class="odd" valign="top">
<td>Delete</td>
<td>Del</td>
<td>Del, Meta+D</td>
<td>Del, Ctrl+D</td>
<td>Del, Ctrl+D</td>
<td>Del</td>
</tr>
<tr class="even" valign="top">
<td>Cut</td>
<td>Ctrl+X, Shift+Del</td>
<td>Ctrl+X</td>
<td>Ctrl+X, F20, Shift+Del</td>
<td>Ctrl+X, F20, Shift+Del</td>
<td>Ctrl+X</td>
</tr>
<tr class="odd" valign="top">
<td>Copy</td>
<td>Ctrl+C, Ctrl+Ins</td>
<td>Ctrl+C</td>
<td>Ctrl+C, F16, Ctrl+Ins</td>
<td>Ctrl+C, F16, Ctrl+Ins</td>
<td>Ctrl+C</td>
</tr>
<tr class="even" valign="top">
<td>Paste</td>
<td>Ctrl+V, Shift+Ins</td>
<td>Ctrl+V</td>
<td>Ctrl+V, F18, Shift+Ins</td>
<td>Ctrl+V, F18, Shift+Ins</td>
<td>Ctrl+V</td>
</tr>
<tr class="odd" valign="top">
<td>Preferences</td>
<td />
<td>Ctrl+,</td>
<td />
<td />
<td>(none)</td>
</tr>
<tr class="even" valign="top">
<td>Undo</td>
<td>Ctrl+Z, Alt+Backspace</td>
<td>Ctrl+Z</td>
<td>Ctrl+Z, F14</td>
<td>Ctrl+Z, F14</td>
<td>Ctrl+Z</td>
</tr>
<tr class="odd" valign="top">
<td>Redo</td>
<td>Ctrl+Y, Shift+Ctrl+Z, Alt+Shift+Backspace</td>
<td>Ctrl+Shift+Z</td>
<td>Ctrl+Shift+Z</td>
<td>Ctrl+Shift+Z</td>
<td>(none)</td>
</tr>
<tr class="even" valign="top">
<td>Back</td>
<td>Alt+Left, Backspace</td>
<td>Ctrl+[</td>
<td>Alt+Left</td>
<td>Alt+Left</td>
<td>(none)</td>
</tr>
<tr class="odd" valign="top">
<td>Forward</td>
<td>Alt+Right, Shift+Backspace</td>
<td>Ctrl+]</td>
<td>Alt+Right</td>
<td>Alt+Right</td>
<td>(none)</td>
</tr>
<tr class="even" valign="top">
<td>Refresh</td>
<td>F5</td>
<td>F5</td>
<td>F5</td>
<td>Ctrl+R, F5</td>
<td>(none)</td>
</tr>
<tr class="odd" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">ZoomIn</a></td>
<td>Ctrl+Plus</td>
<td>Ctrl+Plus</td>
<td>Ctrl+Plus</td>
<td>Ctrl+Plus</td>
<td>(none)</td>
</tr>
<tr class="even" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">ZoomOut</a></td>
<td>Ctrl+Minus</td>
<td>Ctrl+Minus</td>
<td>Ctrl+Minus</td>
<td>Ctrl+Minus</td>
<td>(none)</td>
</tr>
<tr class="odd" valign="top">
<td>Print</td>
<td>Ctrl+P</td>
<td>Ctrl+P</td>
<td>Ctrl+P</td>
<td>Ctrl+P</td>
<td>(none)</td>
</tr>
<tr class="even" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">AddTab</a></td>
<td>Ctrl+T</td>
<td>Ctrl+T</td>
<td>Ctrl+Shift+N, Ctrl+T</td>
<td>Ctrl+T</td>
<td>(none)</td>
</tr>
<tr class="odd" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">NextChild</a></td>
<td>Ctrl+Tab, Forward, Ctrl+F6</td>
<td>Ctrl+}, Forward, Ctrl+Tab</td>
<td>Ctrl+Tab, Forward, Ctrl+Comma</td>
<td>Ctrl+Tab, Forward</td>
<td>(none)</td>
</tr>
<tr class="even" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">PreviousChild</a></td>
<td>Ctrl+Shift+Tab, Back, Ctrl+Shift+F6</td>
<td>Ctrl+{, Back, Ctrl+Shift+Tab</td>
<td>Ctrl+Shift+Tab, Back, Ctrl+Period</td>
<td>Ctrl+Shift+Tab, Back</td>
<td>(none)</td>
</tr>
<tr class="odd" valign="top">
<td>Find</td>
<td>Ctrl+F</td>
<td>Ctrl+F</td>
<td>Ctrl+F</td>
<td>Ctrl+F</td>
<td>(none)</td>
</tr>
<tr class="even" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">FindNext</a></td>
<td>F3, Ctrl+G</td>
<td>Ctrl+G</td>
<td>F3</td>
<td>Ctrl+G, F3</td>
<td>(none)</td>
</tr>
<tr class="odd" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">FindPrevious</a></td>
<td>Shift+F3, Ctrl+Shift+G</td>
<td>Ctrl+Shift+G</td>
<td>Shift+F3</td>
<td>Ctrl+Shift+G, Shift+F3</td>
<td>(none)</td>
</tr>
<tr class="even" valign="top">
<td>Replace</td>
<td>Ctrl+H</td>
<td>(none)</td>
<td>Ctrl+R</td>
<td>Ctrl+H</td>
<td>(none)</td>
</tr>
<tr class="odd" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">SelectAll</a></td>
<td>Ctrl+A</td>
<td>Ctrl+A</td>
<td>Ctrl+A</td>
<td>Ctrl+A</td>
<td>(none)</td>
</tr>
<tr class="even" valign="top">
<td>Bold</td>
<td>Ctrl+B</td>
<td>Ctrl+B</td>
<td>Ctrl+B</td>
<td>Ctrl+B</td>
<td>(none)</td>
</tr>
<tr class="odd" valign="top">
<td>Italic</td>
<td>Ctrl+I</td>
<td>Ctrl+I</td>
<td>Ctrl+I</td>
<td>Ctrl+I</td>
<td>(none)</td>
</tr>
<tr class="even" valign="top">
<td>Underline</td>
<td>Ctrl+U</td>
<td>Ctrl+U</td>
<td>Ctrl+U</td>
<td>Ctrl+U</td>
<td>(none)</td>
</tr>
<tr class="odd" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">MoveToNextChar</a></td>
<td>Right</td>
<td>Right</td>
<td>Right</td>
<td>Right</td>
<td>Right</td>
</tr>
<tr class="even" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">MoveToPreviousChar</a></td>
<td>Left</td>
<td>Left</td>
<td>Left</td>
<td>Left</td>
<td>Left</td>
</tr>
<tr class="odd" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">MoveToNextWord</a></td>
<td>Ctrl+Right</td>
<td>Alt+Right</td>
<td>Ctrl+Right</td>
<td>Ctrl+Right</td>
<td>Ctrl+Right</td>
</tr>
<tr class="even" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">MoveToPreviousWord</a></td>
<td>Ctrl+Left</td>
<td>Alt+Left</td>
<td>Ctrl+Left</td>
<td>Ctrl+Left</td>
<td>Ctrl+Left</td>
</tr>
<tr class="odd" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">MoveToNextLine</a></td>
<td>Down</td>
<td>Down</td>
<td>Down</td>
<td>Down</td>
<td>Down</td>
</tr>
<tr class="even" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">MoveToPreviousLine</a></td>
<td>Up</td>
<td>Up</td>
<td>Up</td>
<td>Up</td>
<td>Up</td>
</tr>
<tr class="odd" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">MoveToNextPage</a></td>
<td>PgDown</td>
<td>PgDown, Alt+PgDown, Meta+Down, Meta+PgDown</td>
<td>PgDown</td>
<td>PgDown</td>
<td>PgDown</td>
</tr>
<tr class="even" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">MoveToPreviousPage</a></td>
<td>PgUp</td>
<td>PgUp, Alt+PgUp, Meta+Up, Meta+PgUp</td>
<td>PgUp</td>
<td>PgUp</td>
<td>PgUp</td>
</tr>
<tr class="odd" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">MoveToStartOfLine</a></td>
<td>Home</td>
<td>Ctrl+Left, Meta+Left</td>
<td>Home</td>
<td>Home</td>
<td>Home</td>
</tr>
<tr class="even" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">MoveToEndOfLine</a></td>
<td>End</td>
<td>Ctrl+Right, Meta+Right</td>
<td>End</td>
<td>End</td>
<td>End</td>
</tr>
<tr class="odd" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">MoveToStartOfBlock</a></td>
<td>(none)</td>
<td>Alt+Up, Meta+A</td>
<td>(none)</td>
<td>(none)</td>
<td>(none)</td>
</tr>
<tr class="even" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">MoveToEndOfBlock</a></td>
<td>(none)</td>
<td>Alt+Down, Meta+E</td>
<td>(none)</td>
<td>(none)</td>
<td>(none)</td>
</tr>
<tr class="odd" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">MoveToStartOfDocument</a></td>
<td>Ctrl+Home</td>
<td>Ctrl+Up, Home</td>
<td>Ctrl+Home</td>
<td>Ctrl+Home</td>
<td>Ctrl+Home</td>
</tr>
<tr class="even" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">MoveToEndOfDocument</a></td>
<td>Ctrl+End</td>
<td>Ctrl+Down, End</td>
<td>Ctrl+End</td>
<td>Ctrl+End</td>
<td>Ctrl+End</td>
</tr>
<tr class="odd" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">SelectNextChar</a></td>
<td>Shift+Right</td>
<td>Shift+Right</td>
<td>Shift+Right</td>
<td>Shift+Right</td>
<td>Shift+Right</td>
</tr>
<tr class="even" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">SelectPreviousChar</a></td>
<td>Shift+Left</td>
<td>Shift+Left</td>
<td>Shift+Left</td>
<td>Shift+Left</td>
<td>Shift+Left</td>
</tr>
<tr class="odd" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">SelectNextWord</a></td>
<td>Ctrl+Shift+Right</td>
<td>Alt+Shift+Right</td>
<td>Ctrl+Shift+Right</td>
<td>Ctrl+Shift+Right</td>
<td>Ctrl+Shift+Right</td>
</tr>
<tr class="even" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">SelectPreviousWord</a></td>
<td>Ctrl+Shift+Left</td>
<td>Alt+Shift+Left</td>
<td>Ctrl+Shift+Left</td>
<td>Ctrl+Shift+Left</td>
<td>Ctrl+Shift+Left</td>
</tr>
<tr class="odd" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">SelectNextLine</a></td>
<td>Shift+Down</td>
<td>Shift+Down</td>
<td>Shift+Down</td>
<td>Shift+Down</td>
<td>Shift+Down</td>
</tr>
<tr class="even" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">SelectPreviousLine</a></td>
<td>Shift+Up</td>
<td>Shift+Up</td>
<td>Shift+Up</td>
<td>Shift+Up</td>
<td>Shift+Up</td>
</tr>
<tr class="odd" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">SelectNextPage</a></td>
<td>Shift+PgDown</td>
<td>Shift+PgDown</td>
<td>Shift+PgDown</td>
<td>Shift+PgDown</td>
<td>Shift+PgDown</td>
</tr>
<tr class="even" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">SelectPreviousPage</a></td>
<td>Shift+PgUp</td>
<td>Shift+PgUp</td>
<td>Shift+PgUp</td>
<td>Shift+PgUp</td>
<td>Shift+PgUp</td>
</tr>
<tr class="odd" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">SelectStartOfLine</a></td>
<td>Shift+Home</td>
<td>Ctrl+Shift+Left</td>
<td>Shift+Home</td>
<td>Shift+Home</td>
<td>Shift+Home</td>
</tr>
<tr class="even" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">SelectEndOfLine</a></td>
<td>Shift+End</td>
<td>Ctrl+Shift+Right</td>
<td>Shift+End</td>
<td>Shift+End</td>
<td>Shift+End</td>
</tr>
<tr class="odd" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">SelectStartOfBlock</a></td>
<td>(none)</td>
<td>Alt+Shift+Up, Meta+Shift+A</td>
<td>(none)</td>
<td>(none)</td>
<td>(none)</td>
</tr>
<tr class="even" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">SelectEndOfBlock</a></td>
<td>(none)</td>
<td>Alt+Shift+Down, Meta+Shift+E</td>
<td>(none)</td>
<td>(none)</td>
<td>(none)</td>
</tr>
<tr class="odd" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">SelectStartOfDocument</a></td>
<td>Ctrl+Shift+Home</td>
<td>Ctrl+Shift+Up, Shift+Home</td>
<td>Ctrl+Shift+Home</td>
<td>Ctrl+Shift+Home</td>
<td>Ctrl+Shift+Home</td>
</tr>
<tr class="even" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">SelectEndOfDocument</a></td>
<td>Ctrl+Shift+End</td>
<td>Ctrl+Shift+Down, Shift+End</td>
<td>Ctrl+Shift+End</td>
<td>Ctrl+Shift+End</td>
<td>Ctrl+Shift+End</td>
</tr>
<tr class="odd" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">DeleteStartOfWord</a></td>
<td>Ctrl+Backspace</td>
<td>Alt+Backspace</td>
<td>Ctrl+Backspace</td>
<td>Ctrl+Backspace</td>
<td>(none)</td>
</tr>
<tr class="even" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">DeleteEndOfWord</a></td>
<td>Ctrl+Del</td>
<td>(none)</td>
<td>Ctrl+Del</td>
<td>Ctrl+Del</td>
<td>(none)</td>
</tr>
<tr class="odd" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">DeleteEndOfLine</a></td>
<td>(none)</td>
<td>(none)</td>
<td>Ctrl+K</td>
<td>Ctrl+K</td>
<td>(none)</td>
</tr>
<tr class="even" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">InsertParagraphSeparator</a></td>
<td>Enter</td>
<td>Enter</td>
<td>Enter</td>
<td>Enter</td>
<td>(none)</td>
</tr>
<tr class="odd" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">InsertLineSeparator</a></td>
<td>Shift+Enter</td>
<td>Meta+Enter</td>
<td>Shift+Enter</td>
<td>Shift+Enter</td>
<td>(none)</td>
</tr>
</table>
<p>Note that, since the key sequences used for the standard
shortcuts differ between platforms, you still need to test your
shortcuts on each platform to ensure that you do not
unintentionally assign the same key sequence to many actions.</p>
<a id="keyboard-layout-issues" name="keyboard-layout-issues" />
<h3>Keyboard Layout Issues</h3>
<p>Many key sequence specifications are chosen by developers based
on the layout of certain types of keyboard, rather than choosing
keys that represent the first letter of an action's name, such as
<b>Ctrl S</b> ("Ctrl+S") or <b>Ctrl C</b> ("Ctrl+C"). Additionally,
because certain symbols can only be entered with the help of
modifier keys on certain keyboard layouts, key sequences intended
for use with one keyboard layout may map to a different key, map to
no keys at all, or require an additional modifier key to be used on
different keyboard layouts.</p>
<p>For example, the shortcuts, <b>Ctrl plus</b> and <b>Ctrl
minus</b>, are often used as shortcuts for zoom operations in
graphics applications, and these may be specified as "Ctrl++" and
"Ctrl+-" respectively. However, the way these shortcuts are
specified and interpreted depends on the keyboard layout. Users of
Norwegian keyboards will note that the <b>+</b> and <b>-</b> keys
are not adjacent on the keyboard, but will still be able to
activate both shortcuts without needing to press the <b>Shift</b>
key. However, users with British keyboards will need to hold down
the <b>Shift</b> key to enter the <b>+</b> symbol, making the
shortcut effectively the same as "Ctrl+Shift+=".</p>
<p>Although some developers might resort to fully specifying all
the modifiers they use on their keyboards to activate a shortcut,
this will also result in unexpected behavior for users of different
keyboard layouts.</p>
<p>For example, a developer using a British keyboard may decide to
specify "Ctrl+Shift+=" as the key sequence in order to create a
shortcut that coincidentally behaves in the same way as <b>Ctrl
plus</b>. However, the <b>=</b> key needs to be accessed using the
<b>Shift</b> key on Norwegian keyboard, making the required
shortcut effectively <b>Ctrl Shift Shift =</b> (an impossible key
combination).</p>
<p>As a result, both human-readable strings and hard-coded key
codes can both be problematic to use when specifying a key sequence
that can be used on a variety of different keyboard layouts. Only
the use of <a href="qkeysequence.html#StandardKey-enum">standard
shortcuts</a> guarantees that the user will be able to use the
shortcuts that the developer intended.</p>
<p>Despite this, we can address this issue by ensuring that
human-readable strings are used, making it possible for
translations of key sequences to be made for users of different
languages. This approach will be successful for users whose
keyboards have the most typical layout for the language they are
using.</p>
<a id="gnu-emacs-style-key-sequences" name="gnu-emacs-style-key-sequences" />
<h3>GNU Emacs Style Key Sequences</h3>
<p>Key sequences similar to those used in <a href="http://www.gnu.org/software/emacs/">GNU Emacs</a>, allowing up to
four key codes, can be created by using the multiple argument
constructor, or by passing a human-readable string of
comma-separated key sequences.</p>
<p>For example, the key sequence, <b>Ctrl X</b> followed by <b>Ctrl
C</b>, can be specified using either of the following ways:</p>
<pre class="cpp">
 <span class="type">QKeySequence</span>(tr(<span class="string">"Ctrl+X, Ctrl+C"</span>));
 <span class="type">QKeySequence</span>(<span class="type"><a href="qt.html">Qt</a></span><span class="operator">.</span>CTRL <span class="operator">+</span> <span class="type"><a href="qt.html">Qt</a></span><span class="operator">.</span>Key_X<span class="operator">,</span> <span class="type"><a href="qt.html">Qt</a></span><span class="operator">.</span>CTRL <span class="operator">+</span> <span class="type"><a href="qt.html">Qt</a></span><span class="operator">.</span>Key_C);
</pre>
<p><b>Warning:</b> A <a href="qapplication.html">QApplication</a>
instance must have been constructed before a QKeySequence is
created; otherwise, your application may crash.</p>
<hr /><h2>Type Documentation</h2><h3 class="fn"><a name="SequenceFormat-enum" />QKeySequence.SequenceFormat</h3><table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.NativeText</tt></td>
<td class="topAlign"><tt>0</tt></td>
<td class="topAlign">The key sequence as a platform specific
string. This means that it will be shown translated and on the Mac
it will resemble a key sequence from the menu bar. This enum is
best used when you want to display the string to the user.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.PortableText</tt></td>
<td class="topAlign"><tt>1</tt></td>
<td class="topAlign">The key sequence is given in a "portable"
format, suitable for reading and writing to a file. In many cases,
it will look similar to the native text on Windows and X11.</td>
</tr>
</table>


<h3 class="fn"><a name="SequenceMatch-enum" />QKeySequence.SequenceMatch</h3><table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.NoMatch</tt></td>
<td class="topAlign"><tt>0</tt></td>
<td class="topAlign">The key sequences are different; not even
partially matching.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.PartialMatch</tt></td>
<td class="topAlign"><tt>1</tt></td>
<td class="topAlign">The key sequences match partially, but are not
the same.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.ExactMatch</tt></td>
<td class="topAlign"><tt>2</tt></td>
<td class="topAlign">The key sequences are the same.</td>
</tr>
</table>


<h3 class="fn"><a name="StandardKey-enum" />QKeySequence.StandardKey</h3><p>This enum represent standard key bindings. They can be used to
assign platform dependent keyboard shortcuts to a <a href="qaction.html">QAction</a>.</p>
<p>Note that the key bindings are platform dependent. The currently
bound shortcuts can be queried using <a href="qkeysequence.html#keyBindings">keyBindings</a>().</p>
<table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.AddTab</tt></td>
<td class="topAlign"><tt>19</tt></td>
<td class="topAlign">Add new tab.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.Back</tt></td>
<td class="topAlign"><tt>13</tt></td>
<td class="topAlign">Navigate back.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.Bold</tt></td>
<td class="topAlign"><tt>27</tt></td>
<td class="topAlign">Bold text.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.Close</tt></td>
<td class="topAlign"><tt>4</tt></td>
<td class="topAlign">Close document/tab.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.Copy</tt></td>
<td class="topAlign"><tt>9</tt></td>
<td class="topAlign">Copy.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.Cut</tt></td>
<td class="topAlign"><tt>8</tt></td>
<td class="topAlign">Cut.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.Delete</tt></td>
<td class="topAlign"><tt>7</tt></td>
<td class="topAlign">Delete.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.DeleteEndOfLine</tt></td>
<td class="topAlign"><tt>60</tt></td>
<td class="topAlign">Delete end of line.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.DeleteEndOfWord</tt></td>
<td class="topAlign"><tt>59</tt></td>
<td class="topAlign">Delete word from the end of the cursor.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.DeleteStartOfWord</tt></td>
<td class="topAlign"><tt>58</tt></td>
<td class="topAlign">Delete the beginning of a word up to the
cursor.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.Find</tt></td>
<td class="topAlign"><tt>22</tt></td>
<td class="topAlign">Find in document.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.FindNext</tt></td>
<td class="topAlign"><tt>23</tt></td>
<td class="topAlign">Find next result.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.FindPrevious</tt></td>
<td class="topAlign"><tt>24</tt></td>
<td class="topAlign">Find previous result.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.Forward</tt></td>
<td class="topAlign"><tt>14</tt></td>
<td class="topAlign">Navigate forward.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.HelpContents</tt></td>
<td class="topAlign"><tt>1</tt></td>
<td class="topAlign">Open help contents.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QKeySequence.InsertLineSeparator</tt></td>
<td class="topAlign"><tt>62</tt></td>
<td class="topAlign">Insert a new line.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QKeySequence.InsertParagraphSeparator</tt></td>
<td class="topAlign"><tt>61</tt></td>
<td class="topAlign">Insert a new paragraph.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.Italic</tt></td>
<td class="topAlign"><tt>28</tt></td>
<td class="topAlign">Italic text.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.MoveToEndOfBlock</tt></td>
<td class="topAlign"><tt>41</tt></td>
<td class="topAlign">Move cursor to end of block. This shortcut is
only used on the OS X.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QKeySequence.MoveToEndOfDocument</tt></td>
<td class="topAlign"><tt>43</tt></td>
<td class="topAlign">Move cursor to end of document.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.MoveToEndOfLine</tt></td>
<td class="topAlign"><tt>39</tt></td>
<td class="topAlign">Move cursor to end of line.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.MoveToNextChar</tt></td>
<td class="topAlign"><tt>30</tt></td>
<td class="topAlign">Move cursor to next character.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.MoveToNextLine</tt></td>
<td class="topAlign"><tt>34</tt></td>
<td class="topAlign">Move cursor to next line.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.MoveToNextPage</tt></td>
<td class="topAlign"><tt>36</tt></td>
<td class="topAlign">Move cursor to next page.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.MoveToNextWord</tt></td>
<td class="topAlign"><tt>32</tt></td>
<td class="topAlign">Move cursor to next word.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.MoveToPreviousChar</tt></td>
<td class="topAlign"><tt>31</tt></td>
<td class="topAlign">Move cursor to previous character.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.MoveToPreviousLine</tt></td>
<td class="topAlign"><tt>35</tt></td>
<td class="topAlign">Move cursor to previous line.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.MoveToPreviousPage</tt></td>
<td class="topAlign"><tt>37</tt></td>
<td class="topAlign">Move cursor to previous page.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.MoveToPreviousWord</tt></td>
<td class="topAlign"><tt>33</tt></td>
<td class="topAlign">Move cursor to previous word.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.MoveToStartOfBlock</tt></td>
<td class="topAlign"><tt>40</tt></td>
<td class="topAlign">Move cursor to start of a block. This shortcut
is only used on OS X.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QKeySequence.MoveToStartOfDocument</tt></td>
<td class="topAlign"><tt>42</tt></td>
<td class="topAlign">Move cursor to start of document.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.MoveToStartOfLine</tt></td>
<td class="topAlign"><tt>38</tt></td>
<td class="topAlign">Move cursor to start of line.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.New</tt></td>
<td class="topAlign"><tt>6</tt></td>
<td class="topAlign">Create new document.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.NextChild</tt></td>
<td class="topAlign"><tt>20</tt></td>
<td class="topAlign">Navigate to next tab or child window.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.Open</tt></td>
<td class="topAlign"><tt>3</tt></td>
<td class="topAlign">Open document.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.Paste</tt></td>
<td class="topAlign"><tt>10</tt></td>
<td class="topAlign">Paste.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.Preferences</tt></td>
<td class="topAlign"><tt>64</tt></td>
<td class="topAlign">Open the preferences dialog.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.PreviousChild</tt></td>
<td class="topAlign"><tt>21</tt></td>
<td class="topAlign">Navigate to previous tab or child window.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.Print</tt></td>
<td class="topAlign"><tt>18</tt></td>
<td class="topAlign">Print document.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.Quit</tt></td>
<td class="topAlign"><tt>65</tt></td>
<td class="topAlign">Quit the application.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.Redo</tt></td>
<td class="topAlign"><tt>12</tt></td>
<td class="topAlign">Redo.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.Refresh</tt></td>
<td class="topAlign"><tt>15</tt></td>
<td class="topAlign">Refresh or reload current document.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.Replace</tt></td>
<td class="topAlign"><tt>25</tt></td>
<td class="topAlign">Find and replace.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.SaveAs</tt></td>
<td class="topAlign"><tt>63</tt></td>
<td class="topAlign">Save document after prompting the user for a
file name.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.Save</tt></td>
<td class="topAlign"><tt>5</tt></td>
<td class="topAlign">Save document.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.SelectAll</tt></td>
<td class="topAlign"><tt>26</tt></td>
<td class="topAlign">Select all text.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.SelectEndOfBlock</tt></td>
<td class="topAlign"><tt>55</tt></td>
<td class="topAlign">Extend selection to the end of a text block.
This shortcut is only used on OS X.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QKeySequence.SelectEndOfDocument</tt></td>
<td class="topAlign"><tt>57</tt></td>
<td class="topAlign">Extend selection to end of document.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.SelectEndOfLine</tt></td>
<td class="topAlign"><tt>53</tt></td>
<td class="topAlign">Extend selection to end of line.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.SelectNextChar</tt></td>
<td class="topAlign"><tt>44</tt></td>
<td class="topAlign">Extend selection to next character.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.SelectNextLine</tt></td>
<td class="topAlign"><tt>48</tt></td>
<td class="topAlign">Extend selection to next line.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.SelectNextPage</tt></td>
<td class="topAlign"><tt>50</tt></td>
<td class="topAlign">Extend selection to next page.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.SelectNextWord</tt></td>
<td class="topAlign"><tt>46</tt></td>
<td class="topAlign">Extend selection to next word.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.SelectPreviousChar</tt></td>
<td class="topAlign"><tt>45</tt></td>
<td class="topAlign">Extend selection to previous character.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.SelectPreviousLine</tt></td>
<td class="topAlign"><tt>49</tt></td>
<td class="topAlign">Extend selection to previous line.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.SelectPreviousPage</tt></td>
<td class="topAlign"><tt>51</tt></td>
<td class="topAlign">Extend selection to previous page.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.SelectPreviousWord</tt></td>
<td class="topAlign"><tt>47</tt></td>
<td class="topAlign">Extend selection to previous word.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.SelectStartOfBlock</tt></td>
<td class="topAlign"><tt>54</tt></td>
<td class="topAlign">Extend selection to the start of a text block.
This shortcut is only used on OS X.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QKeySequence.SelectStartOfDocument</tt></td>
<td class="topAlign"><tt>56</tt></td>
<td class="topAlign">Extend selection to start of document.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.SelectStartOfLine</tt></td>
<td class="topAlign"><tt>52</tt></td>
<td class="topAlign">Extend selection to start of line.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.Underline</tt></td>
<td class="topAlign"><tt>29</tt></td>
<td class="topAlign">Underline text.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.Undo</tt></td>
<td class="topAlign"><tt>11</tt></td>
<td class="topAlign">Undo.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.UnknownKey</tt></td>
<td class="topAlign"><tt>0</tt></td>
<td class="topAlign">Unbound key.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.WhatsThis</tt></td>
<td class="topAlign"><tt>2</tt></td>
<td class="topAlign">Activate whats this.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.ZoomIn</tt></td>
<td class="topAlign"><tt>16</tt></td>
<td class="topAlign">Zoom in.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.ZoomOut</tt></td>
<td class="topAlign"><tt>17</tt></td>
<td class="topAlign">Zoom out.</td>
</tr>
</table>
<p>This enum was introduced or modified in Qt 4.2.</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QKeySequence" />QKeySequence.__init__ (<i>self</i>)</h3><p>Constructs an empty key sequence.</p>


<h3 class="fn"><a name="QKeySequence-2" />QKeySequence.__init__ (<i>self</i>, <a href="qkeysequence.html">QKeySequence</a>&#160;<i>ks</i>)</h3><p>Creates a key sequence from the <i>key</i> string. For example
"Ctrl+O" gives CTRL+'O'. The strings "Ctrl", "Shift", "Alt" and
"Meta" are recognized, as well as their translated equivalents in
the "<a href="qshortcut.html">QShortcut</a>" context (using
<a href="qobject.html#tr">QObject.tr</a>()).</p>
<p>Up to four key codes may be entered by separating them with
commas, e.g. "Alt+X,Ctrl+S,Q".</p>
<p><i>key</i> should be in <a href="qkeysequence.html#SequenceFormat-enum">NativeText</a> format.</p>
<p>This constructor is typically used with <a href="qobject.html#tr">tr</a>(), so that shortcut keys can be replaced
in translations:</p>
<pre class="cpp">
 <span class="type"><a href="qmenu.html">QMenu</a></span> <span class="operator">*</span>file <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qmenu.html">QMenu</a></span>(<span class="keyword">this</span>);
 file<span class="operator">-</span><span class="operator">&gt;</span>addAction(tr(<span class="string">"&amp;Open..."</span>)<span class="operator">,</span> <span class="keyword">this</span><span class="operator">,</span> SLOT(open())<span class="operator">,</span>
                   <span class="type"><a href="qkeysequence.html">QKeySequence</a></span>(tr(<span class="string">"Ctrl+O"</span><span class="operator">,</span> <span class="string">"File|Open"</span>)));
</pre>
<p>Note the "File|Open" translator comment. It is by no means
necessary, but it provides some context for the human
translator.</p>


<h3 class="fn"><a name="QKeySequence-3" />QKeySequence.__init__ (<i>self</i>, QString&#160;<i>key</i>, <a href="qkeysequence.html#SequenceFormat-enum">SequenceFormat</a>&#160;<i>format</i>)</h3><p>Creates a key sequence from the <i>key</i> string based on
<i>format</i>.</p>
<p>This function was introduced in Qt 4.7.</p>


<h3 class="fn"><a name="QKeySequence-4" />QKeySequence.__init__ (<i>self</i>, int&#160;<i>k1</i>, int&#160;<i>key2</i>&#160;=&#160;0, int&#160;<i>key3</i>&#160;=&#160;0, int&#160;<i>key4</i>&#160;=&#160;0)</h3><p>Constructs a key sequence with up to 4 keys <i>k1</i>,
<i>k2</i>, <i>k3</i> and <i>k4</i>.</p>
<p>The key codes are listed in <a href="qt.html#Key-enum">Qt.Key</a> and can be combined with modifiers
(see <a href="qt.html#Modifier-enum">Qt.Modifier</a>) such as
<a href="qt.html#Modifier-enum">Qt.SHIFT</a>, <a href="qt.html#Modifier-enum">Qt.CTRL</a>, <a href="qt.html#Modifier-enum">Qt.ALT</a>, or <a href="qt.html#Modifier-enum">Qt.META</a>.</p>


<h3 class="fn"><a name="QKeySequence-5" />QKeySequence.__init__ (<i>self</i>, QVariant&#160;<i>variant</i>)</h3><p>Copy constructor. Makes a copy of <i>keysequence</i>.</p>


<h3 class="fn"><a name="count" />int QKeySequence.count (<i>self</i>)</h3><p>Returns the number of keys in the key sequence. The maximum is
4.</p>


<h3 class="fn"><a name="fromString" /><a href="qkeysequence.html">QKeySequence</a> QKeySequence.fromString (QString&#160;<i>str</i>, <a href="qkeysequence.html#SequenceFormat-enum">SequenceFormat</a>&#160;<i>format</i>&#160;=&#160;QKeySequence.PortableText)</h3><p>Return a <a href="qkeysequence.html">QKeySequence</a> from the
string <i>str</i> based on <i>format</i>.</p>
<p>This function was introduced in Qt 4.1.</p>
<p><b>See also</b> <a href="qkeysequence.html#toString">toString</a>().</p>


<h3 class="fn"><a name="isDetached" />bool QKeySequence.isDetached (<i>self</i>)</h3><h3 class="fn"><a name="isEmpty" />bool QKeySequence.isEmpty (<i>self</i>)</h3><p>Returns true if the key sequence is empty; otherwise returns
false.</p>


<h3 class="fn"><a name="keyBindings" />list-of-QKeySequence QKeySequence.keyBindings (<a href="qkeysequence.html#StandardKey-enum">StandardKey</a>&#160;<i>key</i>)</h3><p>Returns a list of key bindings for the given <i>key</i>. The
result of calling this function will vary based on the target
platform. The first element of the list indicates the primary
shortcut for the given platform. If the result contains more than
one result, these can be considered alternative shortcuts on the
same platform for the given <i>key</i>.</p>
<p>This function was introduced in Qt 4.2.</p>


<h3 class="fn"><a name="matches" /><a href="qkeysequence.html#SequenceMatch-enum">SequenceMatch</a> QKeySequence.matches (<i>self</i>, <a href="qkeysequence.html">QKeySequence</a>&#160;<i>seq</i>)</h3><p>Matches the sequence with <i>seq</i>. Returns <a href="qkeysequence.html#SequenceMatch-enum">ExactMatch</a> if
successful, <a href="qkeysequence.html#SequenceMatch-enum">PartialMatch</a> if
<i>seq</i> matches incompletely, and <a href="qkeysequence.html#SequenceMatch-enum">NoMatch</a> if the sequences
have nothing in common. Returns <a href="qkeysequence.html#SequenceMatch-enum">NoMatch</a> if <i>seq</i> is
shorter.</p>


<h3 class="fn"><a name="mnemonic" /><a href="qkeysequence.html">QKeySequence</a> QKeySequence.mnemonic (QString&#160;<i>text</i>)</h3><p>Returns the shortcut key sequence for the mnemonic in
<i>text</i>, or an empty key sequence if no mnemonics are
found.</p>
<p>For example, mnemonic("E&amp;xit") returns
<tt>Qt.ALT+Qt.Key_X</tt>, mnemonic("&amp;Quit") returns
<tt>ALT+Key_Q</tt>, and mnemonic("Quit") returns an empty <a href="qkeysequence.html">QKeySequence</a>.</p>
<p>We provide a <a href="accelerators.html">list of common
mnemonics</a> in English. At the time of writing, Microsoft and
Open Group do not appear to have issued equivalent recommendations
for other languages.</p>
<p><b>See also</b> <a href="qtcore.html#qt_set_sequence_auto_mnemonic">qt_set_sequence_auto_mnemonic</a>().</p>


<h3 class="fn"><a name="toString" />QString QKeySequence.toString (<i>self</i>, <a href="qkeysequence.html#SequenceFormat-enum">SequenceFormat</a>&#160;<i>format</i>&#160;=&#160;QKeySequence.PortableText)</h3><p>Return a string representation of the key sequence, based on
<i>format</i>.</p>
<p>For example, the value <a href="qt.html#Modifier-enum">Qt.CTRL</a>+<a href="qt.html#Key-enum">Qt.Key_O</a> results in "Ctrl+O". If the key
sequence has multiple key codes, each is separated by commas in the
string returned, such as "Alt+X, Ctrl+Y, Z". The strings, "Ctrl",
"Shift", etc. are translated using <a href="qobject.html#tr">QObject.tr</a>() in the "<a href="qshortcut.html">QShortcut</a>" context.</p>
<p>If the key sequence has no keys, an empty string is
returned.</p>
<p>On Mac OS X, the string returned resembles the sequence that is
shown in the menu bar.</p>
<p>This function was introduced in Qt 4.1.</p>
<p><b>See also</b> <a href="qkeysequence.html#fromString">fromString</a>().</p>


<h3 class="fn"><a name="__eq__" />bool QKeySequence.__eq__ (<i>self</i>, <a href="qkeysequence.html">QKeySequence</a>&#160;<i>other</i>)</h3><h3 class="fn"><a name="__ge__" />bool QKeySequence.__ge__ (<i>self</i>, <a href="qkeysequence.html">QKeySequence</a>&#160;<i>other</i>)</h3><h3 class="fn"><a name="__getitem__" />int QKeySequence.__getitem__ (<i>self</i>, int&#160;<i>i</i>)</h3><h3 class="fn"><a name="__gt__" />bool QKeySequence.__gt__ (<i>self</i>, <a href="qkeysequence.html">QKeySequence</a>&#160;<i>other</i>)</h3><h3 class="fn"><a name="__int__" />int QKeySequence.__int__ (<i>self</i>)</h3><h3 class="fn"><a name="__le__" />bool QKeySequence.__le__ (<i>self</i>, <a href="qkeysequence.html">QKeySequence</a>&#160;<i>other</i>)</h3><h3 class="fn"><a name="__len__" /> QKeySequence.__len__ (<i>self</i>)</h3><h3 class="fn"><a name="__lt__" />bool QKeySequence.__lt__ (<i>self</i>, <a href="qkeysequence.html">QKeySequence</a>&#160;<i>ks</i>)</h3><h3 class="fn"><a name="__ne__" />bool QKeySequence.__ne__ (<i>self</i>, <a href="qkeysequence.html">QKeySequence</a>&#160;<i>other</i>)</h3><address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;4.9.1 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2011</td><td align="right" width="25%">Qt&#160;4.8.0</td></tr></table></div></address></body></html>